package com.yunhe.common.model.data;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yunhe.common.util.NumberUtil;

import java.util.Date;

public class ElectricityBillCheck {

    private Long id;
    private Long firmCode;
    private Long stationCode;
    private String billName;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date startTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date endTime;
    private Double totalCharge;
    private Double totalChargeCheck;
    private Double chargeCost;
    private Double chargeCostCheck;
    private Double totalDischarge;
    private Double totalDischargeCheck;
    private Double dischargeCost;
    private Double dischargeCostCheck;
    private Double totalIncome;
    private Double totalIncomeCheck;
    private Double chargeDeviation;
    private Double chargeDeviationRatio;
    private Double dischargeDeviation;
    private Double dischargeDeviationRatio;
    private Double profitDeviation;
    private Double profitDeviationRatio;

    public Double getChargeDeviation() {
        return NumberUtil.round(totalChargeCheck - totalCharge, 2);
    }

    public void setChargeDeviation(Double chargeDeviation) {
        this.chargeDeviation = chargeDeviation;
    }

    public Double getChargeDeviationRatio() {
        return NumberUtil.round(totalCharge == 0 ? 0 : (totalChargeCheck - totalCharge) / totalCharge * 100, 2);
    }

    public void setChargeDeviationRatio(Double chargeDeviationRatio) {
        this.chargeDeviationRatio = chargeDeviationRatio;
    }

    public Double getDischargeDeviation() {
        return NumberUtil.round(totalDischargeCheck - totalDischarge, 2);
    }

    public void setDischargeDeviation(Double dischargeDeviation) {
        this.dischargeDeviation = dischargeDeviation;
    }

    public Double getDischargeDeviationRatio() {
        return NumberUtil.round(totalDischarge == 0 ? 0 : (totalDischargeCheck - totalDischarge) / totalDischarge * 100, 2);
    }

    public void setDischargeDeviationRatio(Double dischargeDeviationRatio) {
        this.dischargeDeviationRatio = dischargeDeviationRatio;
    }

    public Double getProfitDeviation() {
        return NumberUtil.round(totalIncomeCheck - totalIncome, 2);
    }

    public void setProfitDeviation(Double profitDeviation) {
        this.profitDeviation = profitDeviation;
    }

    public Double getProfitDeviationRatio() {
        return NumberUtil.round(totalIncome == 0 ? 0 : (totalIncomeCheck - totalIncome) / totalIncome * 100, 2);
    }

    public void setProfitDeviationRatio(Double profitDeviationRatio) {
        this.profitDeviationRatio = profitDeviationRatio;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getFirmCode() {
        return firmCode;
    }

    public void setFirmCode(Long firmCode) {
        this.firmCode = firmCode;
    }

    public Long getStationCode() {
        return stationCode;
    }

    public void setStationCode(Long stationCode) {
        this.stationCode = stationCode;
    }

    public String getBillName() {
        return billName;
    }

    public void setBillName(String billName) {
        this.billName = billName;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Double getTotalCharge() {
        return totalCharge;
    }

    public void setTotalCharge(Double totalCharge) {
        this.totalCharge = totalCharge;
    }

    public Double getChargeCost() {
        return chargeCost;
    }

    public void setChargeCost(Double chargeCost) {
        this.chargeCost = chargeCost;
    }

    public Double getTotalDischarge() {
        return totalDischarge;
    }

    public void setTotalDischarge(Double totalDischarge) {
        this.totalDischarge = totalDischarge;
    }

    public Double getDischargeCost() {
        return dischargeCost;
    }

    public void setDischargeCost(Double dischargeCost) {
        this.dischargeCost = dischargeCost;
    }

    public Double getTotalIncome() {
        return totalIncome;
    }

    public void setTotalIncome(Double totalIncome) {
        this.totalIncome = totalIncome;
    }

    public Double getTotalChargeCheck() {
        return totalChargeCheck;
    }

    public void setTotalChargeCheck(Double totalChargeCheck) {
        this.totalChargeCheck = totalChargeCheck;
    }

    public Double getChargeCostCheck() {
        return chargeCostCheck;
    }

    public void setChargeCostCheck(Double chargeCostCheck) {
        this.chargeCostCheck = chargeCostCheck;
    }

    public Double getTotalDischargeCheck() {
        return totalDischargeCheck;
    }

    public void setTotalDischargeCheck(Double totalDischargeCheck) {
        this.totalDischargeCheck = totalDischargeCheck;
    }

    public Double getDischargeCostCheck() {
        return dischargeCostCheck;
    }

    public void setDischargeCostCheck(Double dischargeCostCheck) {
        this.dischargeCostCheck = dischargeCostCheck;
    }

    public Double getTotalIncomeCheck() {
        return totalIncomeCheck;
    }

    public void setTotalIncomeCheck(Double totalIncomeCheck) {
        this.totalIncomeCheck = totalIncomeCheck;
    }
}
